package com.njwt.cloud.mscommon.feign.client;

import com.njwt.cloud.mscommon.feign.fallback.AuthorityClientFallBack;
import com.njwt.cloud.mscommon.support.ApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author <a href="mailto:xingxiaofeng@gtmap.cn">xingxiaofeng</a>
 * @date 2022-06-21
 * @desc AuthorityClient
 */
@FeignClient(contextId = "authorityClient", name ="user-provider",  fallback = AuthorityClientFallBack.class)
public interface AuthorityClient {

    @GetMapping("/authority/api/{id}")
    ApiResponse getAuthorityByUserId(@PathVariable(value = "id",required = false) String id);

    @GetMapping("/authority/api/info")
    ApiResponse getOauthClientDetailsByClientId(@RequestParam("clientId") String clientId);

}
